var Koa = require('koa');
var render = require('koa-swig');
var co = require('co');
var app =new Koa();
var filters = {
  formatVersion: function(version) {
    return '@v' + version;
  }
};
var renderData = {
  name: 'first swig page',
  version:'1.0.0.1',
  user: {
    name: 'fundon',
    email: 'cfddream@gmail.com'
  }
};

app.context.render = co.wrap(render({
  // ...your setting
  writeBody: false,
  filters: filters
}));

app.use(async ctx => ctx.body = await ctx.render('index', renderData));
app.listen(2333);